/* 获取h5列表数据
 * H5List.js
 */
import {REQUEST_URL} from './Constants';
import {postFormData,getData,uploadFiles} from './HttpUtil';

export function h5list(id,limit){
	return getData(REQUEST_URL.H5_GET_LIST,{id:id,limit:limit})
	.then(res=>{
		return res.data;
	},err=>{
		console.log('api h5 list error');
		console.log(err);
	});
}

export function h5delete(id){
	return postFormData(REQUEST_URL.H5_DELETE_DATA,{id:id})
	.then(res=>{
		return res.data;
	},err=>{
		console.log('api h5 list error');
		console.log(err);
	});
}

export function updateTitle(id,title){
	return postFormData(REQUEST_URL.H5_UPDATE_TITLE,{id:id,title:title})
	.then(res=>{
		console.log(res);
		return res.data;
	},err=>{
		console.log('api h5 list error');
		console.log(err);
	});
}

export function h5ModalList(id,limit,catId){
	return getData(REQUEST_URL.H5_MODAL_LIST,{id:id,limit:limit,catId:catId})
	.then(res=>{
		return res.data;
	},err=>{
		console.log('api h5 modal list error');
		console.log(err);
	});
}

export function h5CategoryList(){
	return getData(REQUEST_URL.H5TPL_CATEGORY_URL)
	.then(res=>{
		return res.data;
	},err=>{
		console.log('api h5 modal list error');
		console.log(err);
	});
}